package com.huawei.datafomat;

import java.io.File;
import java.util.List;

/**
 * @program: playgame
 * @Description: 数据操作，如数据的导入和导出
 * @author: crr
 * @date: 2022/4/20
 */
public interface DataOperation<T> {
    /**
     * @Description: data export to a file
     * @Param: [data]
     * @return: int
     * @Author: crr
     * @Date: 2022/4/20
     */
    int dataToFileExport(T data);

    /**
     * @Description: data import from a file
     * @Param: [file]
     * @return: T
     * @Author: crr
     * @Date: 2022/4/20
     */
    T fileToDataImport(File file, Class<T> clazz);

    /**
     * @Description: list data is imported from a file
     * @Param: [file, clazz]
     * @return: T
     * @Author: crr
     * @Date: 2022/4/20
     */
    List<T> fileToListDataImport(File file);
}
